- Python API convention: functions or methods that change an object in place should return None to make it clear to the caller that the object itself was changed
- Default Arguments should have a non-mutable default value.
- Module references:
bisect: Binary Search. Inserting in sorted arraypickle: Serialising/de-serialising data for disk storage.
- Mutable = not hashable.
- Use __setitem__ and __getitem__ in order to provide object[key] functionality.
- Access object attributes:
>>> dir (int)functools.lru_cache(maxsize=128, typed=False)for memoizing the code, much beneficial when fetching info from web or when storing previous results would be helpful.- maxsize = Max number of call results stored.
- typed = stores output of diff. argument types seperately, Eg: 1(int) and 1.0(float)
- Note: It stores everything in a dictionary, with key= *args/**kwargs made in the function call.
__del__is only for interpreter and not developer, as the interpreter calls it and end for cleanup, if you need to do something at clearn up sueatexitmodule.